{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 复习\n",
    "\n",
    "* 收益率，连续收益率，单期收益率与多期收益率的关系\n",
    "\n",
    "* 风险,夏普率"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 掘金多股价数据处理-数据变形与空值处理\n",
    "\n",
    "https://blog.csdn.net/qq_17753903/article/details/89892631"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np  \n",
    "import matplotlib.pyplot as plt  \n",
    "import pandas as pd\n",
    "import akshare as ak"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [],
   "source": [
    "from gm.api import *\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "set_token(\"eea4b28a3ceb7048603d388bb777ebc67de47385\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>symbol</th>\n",
       "      <th>open</th>\n",
       "      <th>close</th>\n",
       "      <th>low</th>\n",
       "      <th>high</th>\n",
       "      <th>eob</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SZSE.000001</td>\n",
       "      <td>10.1555</td>\n",
       "      <td>10.1745</td>\n",
       "      <td>9.9078</td>\n",
       "      <td>10.3396</td>\n",
       "      <td>2015-01-05 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SZSE.000002</td>\n",
       "      <td>10.9058</td>\n",
       "      <td>11.2999</td>\n",
       "      <td>10.7770</td>\n",
       "      <td>11.5879</td>\n",
       "      <td>2015-01-05 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>SZSE.000063</td>\n",
       "      <td>14.7448</td>\n",
       "      <td>15.0698</td>\n",
       "      <td>14.5070</td>\n",
       "      <td>15.3473</td>\n",
       "      <td>2015-01-05 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>SZSE.002007</td>\n",
       "      <td>10.0151</td>\n",
       "      <td>9.9189</td>\n",
       "      <td>9.7445</td>\n",
       "      <td>10.0693</td>\n",
       "      <td>2015-01-05 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>SZSE.000001</td>\n",
       "      <td>10.0665</td>\n",
       "      <td>10.0221</td>\n",
       "      <td>9.8760</td>\n",
       "      <td>10.4095</td>\n",
       "      <td>2015-01-06 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1176</th>\n",
       "      <td>SZSE.002007</td>\n",
       "      <td>13.5467</td>\n",
       "      <td>13.6924</td>\n",
       "      <td>13.5103</td>\n",
       "      <td>14.0841</td>\n",
       "      <td>2015-12-30 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1177</th>\n",
       "      <td>SZSE.000001</td>\n",
       "      <td>9.3036</td>\n",
       "      <td>9.2190</td>\n",
       "      <td>9.2113</td>\n",
       "      <td>9.3267</td>\n",
       "      <td>2015-12-31 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1178</th>\n",
       "      <td>SZSE.000413</td>\n",
       "      <td>8.8681</td>\n",
       "      <td>8.7051</td>\n",
       "      <td>8.7051</td>\n",
       "      <td>8.9448</td>\n",
       "      <td>2015-12-31 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1179</th>\n",
       "      <td>SZSE.000063</td>\n",
       "      <td>18.3058</td>\n",
       "      <td>17.8835</td>\n",
       "      <td>17.8739</td>\n",
       "      <td>18.3058</td>\n",
       "      <td>2015-12-31 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1180</th>\n",
       "      <td>SZSE.002007</td>\n",
       "      <td>13.6621</td>\n",
       "      <td>13.3585</td>\n",
       "      <td>13.3069</td>\n",
       "      <td>13.7805</td>\n",
       "      <td>2015-12-31 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1181 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           symbol     open    close      low     high  \\\n",
       "0     SZSE.000001  10.1555  10.1745   9.9078  10.3396   \n",
       "1     SZSE.000002  10.9058  11.2999  10.7770  11.5879   \n",
       "2     SZSE.000063  14.7448  15.0698  14.5070  15.3473   \n",
       "3     SZSE.002007  10.0151   9.9189   9.7445  10.0693   \n",
       "4     SZSE.000001  10.0665  10.0221   9.8760  10.4095   \n",
       "...           ...      ...      ...      ...      ...   \n",
       "1176  SZSE.002007  13.5467  13.6924  13.5103  14.0841   \n",
       "1177  SZSE.000001   9.3036   9.2190   9.2113   9.3267   \n",
       "1178  SZSE.000413   8.8681   8.7051   8.7051   8.9448   \n",
       "1179  SZSE.000063  18.3058  17.8835  17.8739  18.3058   \n",
       "1180  SZSE.002007  13.6621  13.3585  13.3069  13.7805   \n",
       "\n",
       "                           eob  \n",
       "0    2015-01-05 00:00:00+08:00  \n",
       "1    2015-01-05 00:00:00+08:00  \n",
       "2    2015-01-05 00:00:00+08:00  \n",
       "3    2015-01-05 00:00:00+08:00  \n",
       "4    2015-01-06 00:00:00+08:00  \n",
       "...                        ...  \n",
       "1176 2015-12-30 00:00:00+08:00  \n",
       "1177 2015-12-31 00:00:00+08:00  \n",
       "1178 2015-12-31 00:00:00+08:00  \n",
       "1179 2015-12-31 00:00:00+08:00  \n",
       "1180 2015-12-31 00:00:00+08:00  \n",
       "\n",
       "[1181 rows x 6 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#000413 东旭光电，000063 中兴通讯，002007 华兰生物，000001 平安银行，000002 万科A\n",
    "stock_n = history(symbol='SZSE.000413,SZSE.000063,SZSE.002007,SZSE.000001,SZSE.000002', frequency='1d', start_time='2015-01-01',  end_time='2015-12-31', fields='symbol,open, close, low, high, eob', adjust=ADJUST_PREV, df= True)\n",
    "stock_n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "def time_str(x):\n",
    "    return str(x.date())\n",
    "\n",
    "stock_n.eob=stock_n.eob.apply(time_str)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>symbol</th>\n",
       "      <th>open</th>\n",
       "      <th>close</th>\n",
       "      <th>low</th>\n",
       "      <th>high</th>\n",
       "      <th>eob</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SZSE.000001</td>\n",
       "      <td>10.1555</td>\n",
       "      <td>10.1745</td>\n",
       "      <td>9.9078</td>\n",
       "      <td>10.3396</td>\n",
       "      <td>2015-01-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SZSE.000002</td>\n",
       "      <td>10.9058</td>\n",
       "      <td>11.2999</td>\n",
       "      <td>10.7770</td>\n",
       "      <td>11.5879</td>\n",
       "      <td>2015-01-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>SZSE.000063</td>\n",
       "      <td>14.7448</td>\n",
       "      <td>15.0698</td>\n",
       "      <td>14.5070</td>\n",
       "      <td>15.3473</td>\n",
       "      <td>2015-01-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>SZSE.002007</td>\n",
       "      <td>10.0151</td>\n",
       "      <td>9.9189</td>\n",
       "      <td>9.7445</td>\n",
       "      <td>10.0693</td>\n",
       "      <td>2015-01-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>SZSE.000001</td>\n",
       "      <td>10.0665</td>\n",
       "      <td>10.0221</td>\n",
       "      <td>9.8760</td>\n",
       "      <td>10.4095</td>\n",
       "      <td>2015-01-06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1176</th>\n",
       "      <td>SZSE.002007</td>\n",
       "      <td>13.5467</td>\n",
       "      <td>13.6924</td>\n",
       "      <td>13.5103</td>\n",
       "      <td>14.0841</td>\n",
       "      <td>2015-12-30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1177</th>\n",
       "      <td>SZSE.000001</td>\n",
       "      <td>9.3036</td>\n",
       "      <td>9.2190</td>\n",
       "      <td>9.2113</td>\n",
       "      <td>9.3267</td>\n",
       "      <td>2015-12-31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1178</th>\n",
       "      <td>SZSE.000413</td>\n",
       "      <td>8.8681</td>\n",
       "      <td>8.7051</td>\n",
       "      <td>8.7051</td>\n",
       "      <td>8.9448</td>\n",
       "      <td>2015-12-31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1179</th>\n",
       "      <td>SZSE.000063</td>\n",
       "      <td>18.3058</td>\n",
       "      <td>17.8835</td>\n",
       "      <td>17.8739</td>\n",
       "      <td>18.3058</td>\n",
       "      <td>2015-12-31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1180</th>\n",
       "      <td>SZSE.002007</td>\n",
       "      <td>13.6621</td>\n",
       "      <td>13.3585</td>\n",
       "      <td>13.3069</td>\n",
       "      <td>13.7805</td>\n",
       "      <td>2015-12-31</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1181 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           symbol     open    close      low     high         eob\n",
       "0     SZSE.000001  10.1555  10.1745   9.9078  10.3396  2015-01-05\n",
       "1     SZSE.000002  10.9058  11.2999  10.7770  11.5879  2015-01-05\n",
       "2     SZSE.000063  14.7448  15.0698  14.5070  15.3473  2015-01-05\n",
       "3     SZSE.002007  10.0151   9.9189   9.7445  10.0693  2015-01-05\n",
       "4     SZSE.000001  10.0665  10.0221   9.8760  10.4095  2015-01-06\n",
       "...           ...      ...      ...      ...      ...         ...\n",
       "1176  SZSE.002007  13.5467  13.6924  13.5103  14.0841  2015-12-30\n",
       "1177  SZSE.000001   9.3036   9.2190   9.2113   9.3267  2015-12-31\n",
       "1178  SZSE.000413   8.8681   8.7051   8.7051   8.9448  2015-12-31\n",
       "1179  SZSE.000063  18.3058  17.8835  17.8739  18.3058  2015-12-31\n",
       "1180  SZSE.002007  13.6621  13.3585  13.3069  13.7805  2015-12-31\n",
       "\n",
       "[1181 rows x 6 columns]"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stock_n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>symbol</th>\n",
       "      <th>SZSE.000001</th>\n",
       "      <th>SZSE.000002</th>\n",
       "      <th>SZSE.000063</th>\n",
       "      <th>SZSE.000413</th>\n",
       "      <th>SZSE.002007</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>eob</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2015-01-05</th>\n",
       "      <td>10.1745</td>\n",
       "      <td>11.2999</td>\n",
       "      <td>15.0698</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9.9189</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-06</th>\n",
       "      <td>10.0221</td>\n",
       "      <td>10.8831</td>\n",
       "      <td>15.9418</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10.4331</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-07</th>\n",
       "      <td>9.8316</td>\n",
       "      <td>10.7845</td>\n",
       "      <td>15.6247</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10.2436</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-08</th>\n",
       "      <td>9.5013</td>\n",
       "      <td>10.2995</td>\n",
       "      <td>15.8467</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10.4541</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-09</th>\n",
       "      <td>9.5775</td>\n",
       "      <td>10.1934</td>\n",
       "      <td>15.4979</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10.3369</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-25</th>\n",
       "      <td>9.5420</td>\n",
       "      <td>NaN</td>\n",
       "      <td>18.2482</td>\n",
       "      <td>8.9640</td>\n",
       "      <td>13.2643</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-28</th>\n",
       "      <td>9.2113</td>\n",
       "      <td>NaN</td>\n",
       "      <td>17.6243</td>\n",
       "      <td>8.6668</td>\n",
       "      <td>13.0184</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-29</th>\n",
       "      <td>9.2959</td>\n",
       "      <td>NaN</td>\n",
       "      <td>17.8643</td>\n",
       "      <td>8.7914</td>\n",
       "      <td>13.5467</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-30</th>\n",
       "      <td>9.3036</td>\n",
       "      <td>NaN</td>\n",
       "      <td>18.3826</td>\n",
       "      <td>8.9064</td>\n",
       "      <td>13.6924</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-31</th>\n",
       "      <td>9.2190</td>\n",
       "      <td>NaN</td>\n",
       "      <td>17.8835</td>\n",
       "      <td>8.7051</td>\n",
       "      <td>13.3585</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>244 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "symbol      SZSE.000001  SZSE.000002  SZSE.000063  SZSE.000413  SZSE.002007\n",
       "eob                                                                        \n",
       "2015-01-05      10.1745      11.2999      15.0698          NaN       9.9189\n",
       "2015-01-06      10.0221      10.8831      15.9418          NaN      10.4331\n",
       "2015-01-07       9.8316      10.7845      15.6247          NaN      10.2436\n",
       "2015-01-08       9.5013      10.2995      15.8467          NaN      10.4541\n",
       "2015-01-09       9.5775      10.1934      15.4979          NaN      10.3369\n",
       "...                 ...          ...          ...          ...          ...\n",
       "2015-12-25       9.5420          NaN      18.2482       8.9640      13.2643\n",
       "2015-12-28       9.2113          NaN      17.6243       8.6668      13.0184\n",
       "2015-12-29       9.2959          NaN      17.8643       8.7914      13.5467\n",
       "2015-12-30       9.3036          NaN      18.3826       8.9064      13.6924\n",
       "2015-12-31       9.2190          NaN      17.8835       8.7051      13.3585\n",
       "\n",
       "[244 rows x 5 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stock_close=pd.pivot_table(stock_n,index=[\"eob\"],columns=[\"symbol\"],values=[\"close\"]).close\n",
    "stock_close"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [],
   "source": [
    "#help(stock_close.fillna)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [],
   "source": [
    "data=stock_close.fillna(axis=0,method='ffill')\n",
    "data.fillna(axis=0,method='bfill',inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>symbol</th>\n",
       "      <th>SZSE.000001</th>\n",
       "      <th>SZSE.000002</th>\n",
       "      <th>SZSE.000063</th>\n",
       "      <th>SZSE.000413</th>\n",
       "      <th>SZSE.002007</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>eob</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2015-01-05</th>\n",
       "      <td>10.1745</td>\n",
       "      <td>11.2999</td>\n",
       "      <td>15.0698</td>\n",
       "      <td>8.0181</td>\n",
       "      <td>9.9189</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-06</th>\n",
       "      <td>10.0221</td>\n",
       "      <td>10.8831</td>\n",
       "      <td>15.9418</td>\n",
       "      <td>8.0181</td>\n",
       "      <td>10.4331</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-07</th>\n",
       "      <td>9.8316</td>\n",
       "      <td>10.7845</td>\n",
       "      <td>15.6247</td>\n",
       "      <td>8.0181</td>\n",
       "      <td>10.2436</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-08</th>\n",
       "      <td>9.5013</td>\n",
       "      <td>10.2995</td>\n",
       "      <td>15.8467</td>\n",
       "      <td>8.0181</td>\n",
       "      <td>10.4541</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-09</th>\n",
       "      <td>9.5775</td>\n",
       "      <td>10.1934</td>\n",
       "      <td>15.4979</td>\n",
       "      <td>8.0181</td>\n",
       "      <td>10.3369</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-25</th>\n",
       "      <td>9.5420</td>\n",
       "      <td>19.1382</td>\n",
       "      <td>18.2482</td>\n",
       "      <td>8.9640</td>\n",
       "      <td>13.2643</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-28</th>\n",
       "      <td>9.2113</td>\n",
       "      <td>19.1382</td>\n",
       "      <td>17.6243</td>\n",
       "      <td>8.6668</td>\n",
       "      <td>13.0184</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-29</th>\n",
       "      <td>9.2959</td>\n",
       "      <td>19.1382</td>\n",
       "      <td>17.8643</td>\n",
       "      <td>8.7914</td>\n",
       "      <td>13.5467</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-30</th>\n",
       "      <td>9.3036</td>\n",
       "      <td>19.1382</td>\n",
       "      <td>18.3826</td>\n",
       "      <td>8.9064</td>\n",
       "      <td>13.6924</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-31</th>\n",
       "      <td>9.2190</td>\n",
       "      <td>19.1382</td>\n",
       "      <td>17.8835</td>\n",
       "      <td>8.7051</td>\n",
       "      <td>13.3585</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>244 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "symbol      SZSE.000001  SZSE.000002  SZSE.000063  SZSE.000413  SZSE.002007\n",
       "eob                                                                        \n",
       "2015-01-05      10.1745      11.2999      15.0698       8.0181       9.9189\n",
       "2015-01-06      10.0221      10.8831      15.9418       8.0181      10.4331\n",
       "2015-01-07       9.8316      10.7845      15.6247       8.0181      10.2436\n",
       "2015-01-08       9.5013      10.2995      15.8467       8.0181      10.4541\n",
       "2015-01-09       9.5775      10.1934      15.4979       8.0181      10.3369\n",
       "...                 ...          ...          ...          ...          ...\n",
       "2015-12-25       9.5420      19.1382      18.2482       8.9640      13.2643\n",
       "2015-12-28       9.2113      19.1382      17.6243       8.6668      13.0184\n",
       "2015-12-29       9.2959      19.1382      17.8643       8.7914      13.5467\n",
       "2015-12-30       9.3036      19.1382      18.3826       8.9064      13.6924\n",
       "2015-12-31       9.2190      19.1382      17.8835       8.7051      13.3585\n",
       "\n",
       "[244 rows x 5 columns]"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 多股票收益率计算"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>symbol</th>\n",
       "      <th>SZSE.000001</th>\n",
       "      <th>SZSE.000002</th>\n",
       "      <th>SZSE.000063</th>\n",
       "      <th>SZSE.000413</th>\n",
       "      <th>SZSE.002007</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>eob</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2015-01-05</th>\n",
       "      <td>10.1745</td>\n",
       "      <td>11.2999</td>\n",
       "      <td>15.0698</td>\n",
       "      <td>8.0181</td>\n",
       "      <td>9.9189</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-06</th>\n",
       "      <td>10.0221</td>\n",
       "      <td>10.8831</td>\n",
       "      <td>15.9418</td>\n",
       "      <td>8.0181</td>\n",
       "      <td>10.4331</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-07</th>\n",
       "      <td>9.8316</td>\n",
       "      <td>10.7845</td>\n",
       "      <td>15.6247</td>\n",
       "      <td>8.0181</td>\n",
       "      <td>10.2436</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-08</th>\n",
       "      <td>9.5013</td>\n",
       "      <td>10.2995</td>\n",
       "      <td>15.8467</td>\n",
       "      <td>8.0181</td>\n",
       "      <td>10.4541</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-09</th>\n",
       "      <td>9.5775</td>\n",
       "      <td>10.1934</td>\n",
       "      <td>15.4979</td>\n",
       "      <td>8.0181</td>\n",
       "      <td>10.3369</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-25</th>\n",
       "      <td>9.5420</td>\n",
       "      <td>19.1382</td>\n",
       "      <td>18.2482</td>\n",
       "      <td>8.9640</td>\n",
       "      <td>13.2643</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-28</th>\n",
       "      <td>9.2113</td>\n",
       "      <td>19.1382</td>\n",
       "      <td>17.6243</td>\n",
       "      <td>8.6668</td>\n",
       "      <td>13.0184</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-29</th>\n",
       "      <td>9.2959</td>\n",
       "      <td>19.1382</td>\n",
       "      <td>17.8643</td>\n",
       "      <td>8.7914</td>\n",
       "      <td>13.5467</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-30</th>\n",
       "      <td>9.3036</td>\n",
       "      <td>19.1382</td>\n",
       "      <td>18.3826</td>\n",
       "      <td>8.9064</td>\n",
       "      <td>13.6924</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-31</th>\n",
       "      <td>9.2190</td>\n",
       "      <td>19.1382</td>\n",
       "      <td>17.8835</td>\n",
       "      <td>8.7051</td>\n",
       "      <td>13.3585</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>244 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "symbol      SZSE.000001  SZSE.000002  SZSE.000063  SZSE.000413  SZSE.002007\n",
       "eob                                                                        \n",
       "2015-01-05      10.1745      11.2999      15.0698       8.0181       9.9189\n",
       "2015-01-06      10.0221      10.8831      15.9418       8.0181      10.4331\n",
       "2015-01-07       9.8316      10.7845      15.6247       8.0181      10.2436\n",
       "2015-01-08       9.5013      10.2995      15.8467       8.0181      10.4541\n",
       "2015-01-09       9.5775      10.1934      15.4979       8.0181      10.3369\n",
       "...                 ...          ...          ...          ...          ...\n",
       "2015-12-25       9.5420      19.1382      18.2482       8.9640      13.2643\n",
       "2015-12-28       9.2113      19.1382      17.6243       8.6668      13.0184\n",
       "2015-12-29       9.2959      19.1382      17.8643       8.7914      13.5467\n",
       "2015-12-30       9.3036      19.1382      18.3826       8.9064      13.6924\n",
       "2015-12-31       9.2190      19.1382      17.8835       8.7051      13.3585\n",
       "\n",
       "[244 rows x 5 columns]"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>symbol</th>\n",
       "      <th>SZSE.000001</th>\n",
       "      <th>SZSE.000002</th>\n",
       "      <th>SZSE.000063</th>\n",
       "      <th>SZSE.000413</th>\n",
       "      <th>SZSE.002007</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>eob</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2015-01-06</th>\n",
       "      <td>-0.0150</td>\n",
       "      <td>-0.0369</td>\n",
       "      <td>0.0579</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0518</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-07</th>\n",
       "      <td>-0.0190</td>\n",
       "      <td>-0.0091</td>\n",
       "      <td>-0.0199</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.0182</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-08</th>\n",
       "      <td>-0.0336</td>\n",
       "      <td>-0.0450</td>\n",
       "      <td>0.0142</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0205</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-09</th>\n",
       "      <td>0.0080</td>\n",
       "      <td>-0.0103</td>\n",
       "      <td>-0.0220</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.0112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-12</th>\n",
       "      <td>-0.0206</td>\n",
       "      <td>-0.0245</td>\n",
       "      <td>-0.0210</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0209</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "symbol      SZSE.000001  SZSE.000002  SZSE.000063  SZSE.000413  SZSE.002007\n",
       "eob                                                                        \n",
       "2015-01-06      -0.0150      -0.0369       0.0579          0.0       0.0518\n",
       "2015-01-07      -0.0190      -0.0091      -0.0199          0.0      -0.0182\n",
       "2015-01-08      -0.0336      -0.0450       0.0142          0.0       0.0205\n",
       "2015-01-09       0.0080      -0.0103      -0.0220          0.0      -0.0112\n",
       "2015-01-12      -0.0206      -0.0245      -0.0210          0.0       0.0209"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r=(data/data.shift(1)-1).dropna()\n",
    "\n",
    "r.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [],
   "source": [
    "#r_p[\"000413.XSHE\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 资产风险的测度\n",
    "\n",
    "\n",
    "https://blog.csdn.net/weixin_42219751/article/details/94391315\n",
    "\n",
    "### 方差\n",
    "\n",
    "## 夏普率\n",
    "\n",
    "夏普率(sharpe ratio): 衡量策略相对于无风险组合的表现，是策略所获得风险溢价的度量——即如果策略额外承担一单位的风险，可以获得多少单位的收益作为补偿。\n",
    "\n",
    "https://www.ricequant.com/doc/api/python/chn#backtest-results-factors\n",
    "\n",
    "https://wiki.mbalib.com/wiki/%E5%A4%8F%E6%99%AE%E6%8C%87%E6%95%B0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## classwork1\n",
    "\n",
    "* 请计算SZSE.002007的年度夏普率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 投资组合的收益率与风险"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>symbol</th>\n",
       "      <th>SZSE.000001</th>\n",
       "      <th>SZSE.000002</th>\n",
       "      <th>SZSE.000063</th>\n",
       "      <th>SZSE.000413</th>\n",
       "      <th>SZSE.002007</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>eob</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2015-01-06</th>\n",
       "      <td>-0.0150</td>\n",
       "      <td>-0.0369</td>\n",
       "      <td>0.0579</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0518</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-07</th>\n",
       "      <td>-0.0190</td>\n",
       "      <td>-0.0091</td>\n",
       "      <td>-0.0199</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>-0.0182</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-08</th>\n",
       "      <td>-0.0336</td>\n",
       "      <td>-0.0450</td>\n",
       "      <td>0.0142</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0205</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-09</th>\n",
       "      <td>0.0080</td>\n",
       "      <td>-0.0103</td>\n",
       "      <td>-0.0220</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>-0.0112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-12</th>\n",
       "      <td>-0.0206</td>\n",
       "      <td>-0.0245</td>\n",
       "      <td>-0.0210</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0209</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-25</th>\n",
       "      <td>0.0057</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0058</td>\n",
       "      <td>-0.0043</td>\n",
       "      <td>-0.0057</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-28</th>\n",
       "      <td>-0.0346</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>-0.0342</td>\n",
       "      <td>-0.0332</td>\n",
       "      <td>-0.0185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-29</th>\n",
       "      <td>0.0092</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0136</td>\n",
       "      <td>0.0144</td>\n",
       "      <td>0.0406</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-30</th>\n",
       "      <td>0.0008</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0290</td>\n",
       "      <td>0.0131</td>\n",
       "      <td>0.0108</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-31</th>\n",
       "      <td>-0.0091</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>-0.0272</td>\n",
       "      <td>-0.0226</td>\n",
       "      <td>-0.0244</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>243 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "symbol      SZSE.000001  SZSE.000002  SZSE.000063  SZSE.000413  SZSE.002007\n",
       "eob                                                                        \n",
       "2015-01-06      -0.0150      -0.0369       0.0579       0.0000       0.0518\n",
       "2015-01-07      -0.0190      -0.0091      -0.0199       0.0000      -0.0182\n",
       "2015-01-08      -0.0336      -0.0450       0.0142       0.0000       0.0205\n",
       "2015-01-09       0.0080      -0.0103      -0.0220       0.0000      -0.0112\n",
       "2015-01-12      -0.0206      -0.0245      -0.0210       0.0000       0.0209\n",
       "...                 ...          ...          ...          ...          ...\n",
       "2015-12-25       0.0057       0.0000       0.0058      -0.0043      -0.0057\n",
       "2015-12-28      -0.0346       0.0000      -0.0342      -0.0332      -0.0185\n",
       "2015-12-29       0.0092       0.0000       0.0136       0.0144       0.0406\n",
       "2015-12-30       0.0008       0.0000       0.0290       0.0131       0.0108\n",
       "2015-12-31      -0.0091       0.0000      -0.0272      -0.0226      -0.0244\n",
       "\n",
       "[243 rows x 5 columns]"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.75705536, 0.29337181, 0.52209287, 0.52293348, 0.29734287])"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#随机生成投资组合的权重\n",
    "weights = np.random.random(5)\n",
    "\n",
    "weights"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.31638938, 0.12260625, 0.21819361, 0.21854491, 0.12426585])"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weights = weights/np.sum(weights)\n",
    "\n",
    "weights"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [],
   "source": [
    "weights=np.array([ 0.37505798, 0.21652754, 0.31590981, 0.06087709, 0.03162758])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 组合收益率与点乘"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.1484967 , 0.25120513, 0.29997291, 0.26109273, 0.03923253])"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weights"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.02568078242639"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "0.1484967*0+0.25120513*(-0.014977)+0.29997291*0.057862+0.26109273*0.051833+0.03923253*(-0.036887)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "symbol\n",
       "SZSE.000001   -0.0150\n",
       "SZSE.000002   -0.0369\n",
       "SZSE.000063    0.0579\n",
       "SZSE.000413    0.0000\n",
       "SZSE.002007    0.0518\n",
       "Name: 2015-01-06, dtype: float64"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.loc[\"2015-01-06\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.15716611, 0.29939866, 0.24037151, 0.25762955, 0.04543418])"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weights"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.0244154154845"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "0.15716611*0+0.29939866*0.057980+0.24037151*0.052000-0.25762955*0.014634-0.04543418*0.036820"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.00980416, -0.01372111, -0.01048947, -0.00492169, -0.01148573,\n",
       "        0.00112892,  0.00127781,  0.0212038 ,  0.00037356, -0.06510514,\n",
       "        0.02092655,  0.02953029,  0.0026791 ,  0.00605839,  0.00457151,\n",
       "       -0.01817559, -0.00338803, -0.01071646, -0.01032657, -0.01967668,\n",
       "        0.01763838, -0.01950553, -0.00510917, -0.0229343 ,  0.00654367,\n",
       "        0.01435169,  0.01222904,  0.0030394 ,  0.0126461 ,  0.0180634 ,\n",
       "       -0.00305363, -0.01709501,  0.0172557 ,  0.00368806,  0.01742912,\n",
       "       -0.01043328,  0.0106527 ,  0.01087238,  0.01377932,  0.01697735,\n",
       "       -0.00911194,  0.00266963,  0.0093313 ,  0.01499677,  0.02798674,\n",
       "        0.02634067,  0.01931344, -0.0147251 ,  0.01307806,  0.01351111,\n",
       "       -0.00079651, -0.00537953, -0.00721578,  0.00301429,  0.02622862,\n",
       "       -0.00651461,  0.01859898,  0.0006996 , -0.00384081,  0.03519404,\n",
       "        0.03402392,  0.00598437,  0.03828666,  0.0169246 , -0.01959614,\n",
       "       -0.01455372,  0.02323399,  0.01363807, -0.02235625,  0.03546479,\n",
       "        0.01987797,  0.00651959, -0.00662045,  0.01136294, -0.02006607,\n",
       "        0.02891813,  0.00216282, -0.01298065, -0.04029261, -0.01089037,\n",
       "       -0.00201423,  0.02535818,  0.0214281 ,  0.00069745,  0.01784598,\n",
       "       -0.00382253, -0.02130918,  0.00545963,  0.02382531,  0.00702813,\n",
       "        0.01571808,  0.0145325 ,  0.02550639,  0.01670087,  0.01073819,\n",
       "       -0.067098  , -0.01202902,  0.04427203,  0.01301587, -0.01125131,\n",
       "        0.0008411 ,  0.00506544,  0.01112515, -0.00321478,  0.01491154,\n",
       "        0.01564475, -0.00901762, -0.04491299, -0.03928049,  0.01751095,\n",
       "       -0.03743777, -0.0651194 ,  0.02482658,  0.0151172 , -0.03842875,\n",
       "       -0.08606185, -0.05489625,  0.07955456, -0.03431766, -0.03226451,\n",
       "       -0.03386887,  0.04294889, -0.01895057, -0.06418743,  0.03759393,\n",
       "        0.01685148,  0.00456141,  0.03918289, -0.00954567,  0.0117612 ,\n",
       "        0.04699619,  0.00525726,  0.00326366,  0.00965194,  0.02445625,\n",
       "       -0.01879923, -0.0879456 , -0.00119073,  0.03354116, -0.03557482,\n",
       "        0.00899939,  0.021855  ,  0.03168783, -0.02372941, -0.01092908,\n",
       "        0.02147283,  0.03515901, -0.00434997, -0.02419071,  0.01016392,\n",
       "        0.00988103,  0.00055363, -0.05467524,  0.02991737,  0.00411774,\n",
       "       -0.06048056, -0.09401113, -0.08478646, -0.00639205,  0.05636099,\n",
       "        0.0272338 ,  0.02553977,  0.02028689,  0.00742636, -0.04576644,\n",
       "        0.02626731,  0.01788056, -0.02123756,  0.00820484, -0.04845596,\n",
       "       -0.04218605,  0.06069145, -0.02735286,  0.00589835,  0.02301975,\n",
       "        0.00528381, -0.02090516,  0.00698506, -0.01699197,  0.00574583,\n",
       "       -0.02517593,  0.00621968,  0.03420717,  0.01378853,  0.03415272,\n",
       "        0.00333585, -0.01317541,  0.02752096,  0.00276823,  0.01473037,\n",
       "        0.01130415, -0.04726506,  0.02209178,  0.02256633,  0.0029599 ,\n",
       "       -0.00101176, -0.01105754,  0.00122506,  0.00590811, -0.02254458,\n",
       "       -0.00579369,  0.04939214,  0.01553973,  0.02999966,  0.02094313,\n",
       "       -0.00459658,  0.00012618, -0.01556688, -0.02016436,  0.01529043,\n",
       "        0.00194115, -0.0016189 ,  0.02309378,  0.00781215, -0.01311312,\n",
       "        0.00810496,  0.00183921, -0.00499839, -0.05415234,  0.02938965,\n",
       "        0.01614606,  0.03239501,  0.00762753, -0.01872488,  0.00150613,\n",
       "       -0.02628074,  0.00508636,  0.00025646, -0.00093651,  0.01911962,\n",
       "        0.0109627 , -0.01004076,  0.02752463,  0.01583715,  0.02332361,\n",
       "       -0.00511776, -0.00729232, -0.00043391,  0.00142671, -0.02797305,\n",
       "        0.01406141,  0.01078963, -0.01677218])"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.dot(r,weights)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.013541684048512628"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.dot(r.loc[\"2015-01-06\",:],weights)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>000413.XSHE</th>\n",
       "      <th>000001.XSHE</th>\n",
       "      <th>000063.XSHE</th>\n",
       "      <th>002007.XSHE</th>\n",
       "      <th>000002.XSHE</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2015-01-05</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-06</th>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.014977</td>\n",
       "      <td>0.057862</td>\n",
       "      <td>0.051833</td>\n",
       "      <td>-0.036887</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-07</th>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.019011</td>\n",
       "      <td>-0.019888</td>\n",
       "      <td>-0.018150</td>\n",
       "      <td>-0.009051</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-08</th>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.033598</td>\n",
       "      <td>0.014205</td>\n",
       "      <td>0.020540</td>\n",
       "      <td>-0.044976</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-09</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.008019</td>\n",
       "      <td>-0.022010</td>\n",
       "      <td>-0.011214</td>\n",
       "      <td>-0.010299</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            000413.XSHE  000001.XSHE  000063.XSHE  002007.XSHE  000002.XSHE\n",
       "date                                                                       \n",
       "2015-01-05          NaN          NaN          NaN          NaN          NaN\n",
       "2015-01-06          0.0    -0.014977     0.057862     0.051833    -0.036887\n",
       "2015-01-07          0.0    -0.019011    -0.019888    -0.018150    -0.009051\n",
       "2015-01-08          0.0    -0.033598     0.014205     0.020540    -0.044976\n",
       "2015-01-09          0.0     0.008019    -0.022010    -0.011214    -0.010299"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r[0:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [],
   "source": [
    "#r[1:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.031286770155046696"
      ]
     },
     "execution_count": 101,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sum(np.dot(r[1:5],weights))#区间收益率是否能这样算？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## classwork2\n",
    "\n",
    "* 请计算各个股票各天的日收益率，日连续收益率（np.log），年化连续收益率（sum）\n",
    "\n",
    "* 继续求组合年化连续收益率（weights=[0.1484967 , 0.25120513, 0.29997291, 0.26109273, 0.03923253]）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [],
   "source": [
    "#ln(p2/p1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [],
   "source": [
    "r_log=np.log(data/data.shift(1)).dropna()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "symbol\n",
       "SZSE.000001   -0.0986\n",
       "SZSE.000002    0.5269\n",
       "SZSE.000063    0.1712\n",
       "SZSE.000413    0.0822\n",
       "SZSE.002007    0.2977\n",
       "dtype: float64"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r_log.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "sz000413    0.177968\n",
       "sz000063    0.171404\n",
       "sz002007    0.297880\n",
       "sz000001   -0.098339\n",
       "sz000002    0.526930\n",
       "dtype: float64"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r_log.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [],
   "source": [
    "#weights=[0.1484967 , 0.25120513, 0.29997291, 0.26109273, 0.03923253]\n",
    "weights=np.array([0.1484967 , 0.25120513, 0.29997291, 0.26109273, 0.03923253])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.4379366337871289"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sqrt(np.dot(weights.T, np.dot(r_log.cov()*252, weights)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.15383840792979508"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum(np.dot(r_log,weights))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.3512800621392465"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "0.15383840792979508/0.4379366337871289"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.15139075764544993"
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r_log=(np.log(data/data.shift(1))).dropna()\n",
    "np.sum(np.dot(r_log,weights))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 组合风险与协方差矩阵"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "outputs": [],
   "source": [
    "r4=r[1:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>symbol</th>\n",
       "      <th>SZSE.000001</th>\n",
       "      <th>SZSE.000002</th>\n",
       "      <th>SZSE.000063</th>\n",
       "      <th>SZSE.000413</th>\n",
       "      <th>SZSE.002007</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>eob</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2015-01-07</th>\n",
       "      <td>-0.0190</td>\n",
       "      <td>-0.0091</td>\n",
       "      <td>-0.0199</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.0182</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-08</th>\n",
       "      <td>-0.0336</td>\n",
       "      <td>-0.0450</td>\n",
       "      <td>0.0142</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0205</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-09</th>\n",
       "      <td>0.0080</td>\n",
       "      <td>-0.0103</td>\n",
       "      <td>-0.0220</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.0112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-12</th>\n",
       "      <td>-0.0206</td>\n",
       "      <td>-0.0245</td>\n",
       "      <td>-0.0210</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0209</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "symbol      SZSE.000001  SZSE.000002  SZSE.000063  SZSE.000413  SZSE.002007\n",
       "eob                                                                        \n",
       "2015-01-07      -0.0190      -0.0091      -0.0199          0.0      -0.0182\n",
       "2015-01-08      -0.0336      -0.0450       0.0142          0.0       0.0205\n",
       "2015-01-09       0.0080      -0.0103      -0.0220          0.0      -0.0112\n",
       "2015-01-12      -0.0206      -0.0245      -0.0210          0.0       0.0209"
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>symbol</th>\n",
       "      <th>SZSE.000001</th>\n",
       "      <th>SZSE.000002</th>\n",
       "      <th>SZSE.000063</th>\n",
       "      <th>SZSE.000413</th>\n",
       "      <th>SZSE.002007</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>symbol</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>SZSE.000001</th>\n",
       "      <td>0.0003</td>\n",
       "      <td>0.0002</td>\n",
       "      <td>-0.0002</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.0002</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>SZSE.000002</th>\n",
       "      <td>0.0002</td>\n",
       "      <td>0.0003</td>\n",
       "      <td>-0.0003</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-0.0003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>SZSE.000063</th>\n",
       "      <td>-0.0002</td>\n",
       "      <td>-0.0003</td>\n",
       "      <td>0.0003</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0002</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>SZSE.000413</th>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>SZSE.002007</th>\n",
       "      <td>-0.0002</td>\n",
       "      <td>-0.0003</td>\n",
       "      <td>0.0002</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0004</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "symbol       SZSE.000001  SZSE.000002  SZSE.000063  SZSE.000413  SZSE.002007\n",
       "symbol                                                                      \n",
       "SZSE.000001       0.0003       0.0002      -0.0002          0.0      -0.0002\n",
       "SZSE.000002       0.0002       0.0003      -0.0003          0.0      -0.0003\n",
       "SZSE.000063      -0.0002      -0.0003       0.0003          0.0       0.0002\n",
       "SZSE.000413       0.0000       0.0000       0.0000          0.0       0.0000\n",
       "SZSE.002007      -0.0002      -0.0003       0.0002          0.0       0.0004"
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r4.cov()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "metadata": {},
   "outputs": [],
   "source": [
    "#r4[\"sz000063\"].var()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {},
   "outputs": [],
   "source": [
    "weights=np.array([0.1484967 , 0.25120513, 0.29997291, 0.26109273, 0.03923253])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.04064377223318907"
      ]
     },
     "execution_count": 104,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sqrt(np.dot(weights.T, np.dot(r4.cov()*252, weights)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.04064377223318907"
      ]
     },
     "execution_count": 105,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sqrt(np.dot(weights.T, np.dot(r4.cov()*252, weights)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.43039645517311975"
      ]
     },
     "execution_count": 106,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sqrt(np.dot(weights.T, np.dot(r.cov()*252, weights)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## classwork3\n",
    "\n",
    "\n",
    "* 组合风险和组合夏普率\n",
    "\n",
    "* 循环生成100个随机的权重分配方案，并基于连续收益率r_log，计算出各个方案对应的组合连续收益率和组合风险，并以组合风险为横轴，组合收益为纵轴作散点图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "symbol\n",
       "SZSE.000001   -0.1023\n",
       "SZSE.000002    0.5464\n",
       "SZSE.000063    0.1775\n",
       "SZSE.000413    0.0853\n",
       "SZSE.002007    0.3087\n",
       "dtype: float64"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "returns = np.log(data / data.shift(1))\n",
    "\n",
    "returns.mean()*252"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>symbol</th>\n",
       "      <th>SZSE.000001</th>\n",
       "      <th>SZSE.000002</th>\n",
       "      <th>SZSE.000063</th>\n",
       "      <th>SZSE.000413</th>\n",
       "      <th>SZSE.002007</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>eob</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2015-01-06</th>\n",
       "      <td>-0.0151</td>\n",
       "      <td>-0.0376</td>\n",
       "      <td>0.0563</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0505</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-07</th>\n",
       "      <td>-0.0192</td>\n",
       "      <td>-0.0091</td>\n",
       "      <td>-0.0201</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>-0.0183</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-08</th>\n",
       "      <td>-0.0342</td>\n",
       "      <td>-0.0460</td>\n",
       "      <td>0.0141</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0203</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-09</th>\n",
       "      <td>0.0080</td>\n",
       "      <td>-0.0104</td>\n",
       "      <td>-0.0223</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>-0.0113</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-12</th>\n",
       "      <td>-0.0208</td>\n",
       "      <td>-0.0248</td>\n",
       "      <td>-0.0212</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0207</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-25</th>\n",
       "      <td>0.0057</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0058</td>\n",
       "      <td>-0.0043</td>\n",
       "      <td>-0.0057</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-28</th>\n",
       "      <td>-0.0353</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>-0.0348</td>\n",
       "      <td>-0.0337</td>\n",
       "      <td>-0.0187</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-29</th>\n",
       "      <td>0.0091</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0135</td>\n",
       "      <td>0.0143</td>\n",
       "      <td>0.0398</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-30</th>\n",
       "      <td>0.0008</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0286</td>\n",
       "      <td>0.0130</td>\n",
       "      <td>0.0107</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-31</th>\n",
       "      <td>-0.0091</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>-0.0275</td>\n",
       "      <td>-0.0229</td>\n",
       "      <td>-0.0247</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>243 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "symbol      SZSE.000001  SZSE.000002  SZSE.000063  SZSE.000413  SZSE.002007\n",
       "eob                                                                        \n",
       "2015-01-06      -0.0151      -0.0376       0.0563       0.0000       0.0505\n",
       "2015-01-07      -0.0192      -0.0091      -0.0201       0.0000      -0.0183\n",
       "2015-01-08      -0.0342      -0.0460       0.0141       0.0000       0.0203\n",
       "2015-01-09       0.0080      -0.0104      -0.0223       0.0000      -0.0113\n",
       "2015-01-12      -0.0208      -0.0248      -0.0212       0.0000       0.0207\n",
       "...                 ...          ...          ...          ...          ...\n",
       "2015-12-25       0.0057       0.0000       0.0058      -0.0043      -0.0057\n",
       "2015-12-28      -0.0353       0.0000      -0.0348      -0.0337      -0.0187\n",
       "2015-12-29       0.0091       0.0000       0.0135       0.0143       0.0398\n",
       "2015-12-30       0.0008       0.0000       0.0286       0.0130       0.0107\n",
       "2015-12-31      -0.0091       0.0000      -0.0275      -0.0229      -0.0247\n",
       "\n",
       "[243 rows x 5 columns]"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r_log"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sz000413</th>\n",
       "      <th>sz000063</th>\n",
       "      <th>sz002007</th>\n",
       "      <th>sz000001</th>\n",
       "      <th>sz000002</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2015-01-06</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.056362</td>\n",
       "      <td>0.050693</td>\n",
       "      <td>-0.014742</td>\n",
       "      <td>-0.037515</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-07</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.019901</td>\n",
       "      <td>-0.018226</td>\n",
       "      <td>-0.018991</td>\n",
       "      <td>-0.009603</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-08</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.013724</td>\n",
       "      <td>0.020125</td>\n",
       "      <td>-0.033867</td>\n",
       "      <td>-0.045768</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-09</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.021924</td>\n",
       "      <td>-0.011451</td>\n",
       "      <td>0.007280</td>\n",
       "      <td>-0.010152</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-01-12</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.021121</td>\n",
       "      <td>0.020893</td>\n",
       "      <td>-0.020943</td>\n",
       "      <td>-0.025365</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-25</th>\n",
       "      <td>-0.004454</td>\n",
       "      <td>0.005935</td>\n",
       "      <td>-0.005966</td>\n",
       "      <td>0.006257</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-28</th>\n",
       "      <td>-0.032901</td>\n",
       "      <td>-0.035034</td>\n",
       "      <td>-0.018876</td>\n",
       "      <td>-0.035983</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-29</th>\n",
       "      <td>0.013746</td>\n",
       "      <td>0.013831</td>\n",
       "      <td>0.040334</td>\n",
       "      <td>0.009652</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-30</th>\n",
       "      <td>0.013560</td>\n",
       "      <td>0.028705</td>\n",
       "      <td>0.010197</td>\n",
       "      <td>0.001067</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2015-12-31</th>\n",
       "      <td>-0.022702</td>\n",
       "      <td>-0.027607</td>\n",
       "      <td>-0.024204</td>\n",
       "      <td>-0.009641</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>243 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            sz000413  sz000063  sz002007  sz000001  sz000002\n",
       "date                                                        \n",
       "2015-01-06  0.000000  0.056362  0.050693 -0.014742 -0.037515\n",
       "2015-01-07  0.000000 -0.019901 -0.018226 -0.018991 -0.009603\n",
       "2015-01-08  0.000000  0.013724  0.020125 -0.033867 -0.045768\n",
       "2015-01-09  0.000000 -0.021924 -0.011451  0.007280 -0.010152\n",
       "2015-01-12  0.000000 -0.021121  0.020893 -0.020943 -0.025365\n",
       "...              ...       ...       ...       ...       ...\n",
       "2015-12-25 -0.004454  0.005935 -0.005966  0.006257  0.000000\n",
       "2015-12-28 -0.032901 -0.035034 -0.018876 -0.035983  0.000000\n",
       "2015-12-29  0.013746  0.013831  0.040334  0.009652  0.000000\n",
       "2015-12-30  0.013560  0.028705  0.010197  0.001067  0.000000\n",
       "2015-12-31 -0.022702 -0.027607 -0.024204 -0.009641  0.000000\n",
       "\n",
       "[243 rows x 5 columns]"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r_log"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [],
   "source": [
    "sy=[]\n",
    "fx=[]\n",
    "for i in range(0,10000):\n",
    "    weights = np.random.random(5)\n",
    "    weights = weights/np.sum(weights)\n",
    "    sy.append(np.sum(np.dot(r_log,weights)))\n",
    "    fx.append(np.sqrt(np.dot(weights.T, np.dot(r_log.cov()*252, weights))))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1cd7e395cc8>]"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaH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23fMNT4hItMi8gMRWRfgvV0/1zV0467Ti9d2DdO423pt94ugi2abO17zcQB/pJSqRHhvu2hl3NUDiHwA1dnk/UqpX9c2/yWAywFsBPBzAI/GMVjnx2q2hRn3ZqXUVQBuAPBvROSfxDw+E3Gc7wEANwH4nmNzO893kDH/GFX7ZwOA/wZgMsR720Ur464eoHevba9xt/Xa7hdBPw1gheP3ywCcce2zCcDTIvIGgNsAfFNERnze+wsRuQQAan8HtQ46MW6IiIXqBb9TKfWs/Qal1C+UUhWl1DyA/4HqY2TPjFspdab29y8BfN8xvp4+3zVuAPBjpdQv7A1tPt++Y1ZK/Vop9dvazy8AsETkYp/3dv1ce4y7p69tr3G3/dpu1+JBL/1BtRn2awBWY2EhY53H/n+FhcVF43sBTKBxIePPe2jcAuBvADyu2e8Sx88PAHi6h8a9BMAHHT//CMD1vX6+HdueBvCHnTrfQcYM4MNYSCK8BsCp2vXR09e2x7h7+tr2GHfbr+3Y/qG9/gfAZ1BdDX8VwJdr2+4FcK9m34Yvqu69te0fAvB3AH5W+3t5r4wbwKdQfRR8GcDR2p/P1F77XwCO1V57zvkl6IFxf7T2JZkGcDwp57v2+yCAtwEsde3X1vPtN2YA99XO5TSAQwA+mYRr2zTuXr+2Pcbd9mubqf+EEJIS+sVDJ4SQ1ENBJ4SQlEBBJ4SQlEBBJ4SQlEBBJ4SQlEBBJ4SQlEBBJ4SQlPD/AYr+zjFIxpWFAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(fx,sy,\"o\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x27f1f002d88>]"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgo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mfZ2aqtTUmteiyDcAPK+UspuZ/UcR2S0iaQCjABaitGbN+iJ9ndd+/g8BvKvWizU6cZ1N1mt6PaN0jRvWHIN72W0t3buXlVKJ/w/A31m7qD8E8H/WLuhxj+Pf1ryv3+1nEVvznwBYAvD22n9HAPw9AL8G8B6AfxvB69ywvqhf57Vffw/A4Zrft/06m6zX9HpG6Rpr1hzpe1mz5q7dyz1TASoigwAeBfALpdSnfsd7va/ZcwWlU58TJmGumdfZHd7LnSFu93LPiDkhhCSZXsmZE0JIoqGYE0JIAqCYE0JIAqCYE0JIAqCYE0JIAvj/uom2r+duWJQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(fx,sy,\"o\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.37505798, 0.21652754, 0.31590981, 0.06087709, 0.03162758])"
      ]
     },
     "execution_count": 105,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weights"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sz000413</th>\n",
       "      <th>sz000063</th>\n",
       "      <th>sz002007</th>\n",
       "      <th>sz000001</th>\n",
       "      <th>sz000002</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>sz000413</th>\n",
       "      <td>0.419419</td>\n",
       "      <td>0.206114</td>\n",
       "      <td>0.190556</td>\n",
       "      <td>0.096228</td>\n",
       "      <td>0.080984</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sz000063</th>\n",
       "      <td>0.206114</td>\n",
       "      <td>0.372807</td>\n",
       "      <td>0.212470</td>\n",
       "      <td>0.150696</td>\n",
       "      <td>0.144081</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sz002007</th>\n",
       "      <td>0.190556</td>\n",
       "      <td>0.212470</td>\n",
       "      <td>0.327065</td>\n",
       "      <td>0.097002</td>\n",
       "      <td>0.075067</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sz000001</th>\n",
       "      <td>0.096228</td>\n",
       "      <td>0.150696</td>\n",
       "      <td>0.097002</td>\n",
       "      <td>0.206068</td>\n",
       "      <td>0.138147</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sz000002</th>\n",
       "      <td>0.080984</td>\n",
       "      <td>0.144081</td>\n",
       "      <td>0.075067</td>\n",
       "      <td>0.138147</td>\n",
       "      <td>0.231382</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          sz000413  sz000063  sz002007  sz000001  sz000002\n",
       "sz000413  0.419419  0.206114  0.190556  0.096228  0.080984\n",
       "sz000063  0.206114  0.372807  0.212470  0.150696  0.144081\n",
       "sz002007  0.190556  0.212470  0.327065  0.097002  0.075067\n",
       "sz000001  0.096228  0.150696  0.097002  0.206068  0.138147\n",
       "sz000002  0.080984  0.144081  0.075067  0.138147  0.231382"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r_log.cov()*252"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "metadata": {},
   "outputs": [],
   "source": [
    "#returns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "nan"
      ]
     },
     "execution_count": 107,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sum(np.dot(returns,weights))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [],
   "source": [
    "x=[]\n",
    "y=[]\n",
    "for i in range(1000):\n",
    "    weights = np.random.random(5)\n",
    "    weights = weights/np.sum(weights)\n",
    "    y.append(np.sum(np.dot(r_log,weights)))\n",
    "    x.append(np.sqrt(np.dot(weights.T, np.dot(r_log.cov()*252, weights))))\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAA6MUlEQVR4nO2df5Bc1XXnv6d73mh6RolGEoqC2giwFyQLBDNmAiyksjMkRgItZixhy0BcRXZdFFUhu6jIbGQMRmzwSo5CQXbXCcV6HRIbWwKLnZUj1iJrpEqVFLFInhFCBvEbQY9jK0gtZzQtTU/33T+6b8/r1/e+d9/r1z9e9/lUCaZfvx+nX78+99xzzw8SQoBhGIaJPrFGC8AwDMOEAyt0hmGYFoEVOsMwTIvACp1hGKZFYIXOMAzTInQ06sLnnXeeuOiiixp1+RJnzpxBT09Po8UIRFRlj6rcQHRlj6rcQHRlr5Xchw4d+mchxCLVew1T6BdddBEOHjzYqMuX2Lt3LwYHBxstRiCiKntU5QaiK3tU5QaiK3ut5CaiD3TvscuFYRimRWCFzjAM0yKwQmcYhmkRWKEzDMO0CKzQGYZhWoSGRbm0A6NjKWzdfQwT6QyW9CYwsmoZhvuTjRaLYZgWhRV6jRgdS+Grzx9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      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(x,y,\"o\")\n",
    "#plt.ylim(0,0.5)\n",
    "plt.grid()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAD2CAYAAADcUJy6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/d3fzzAAAACXBIWXMAAAsTAAALEwEAmpwYAABLPUlEQVR4nO29f3Rc1ZXv+d1VurJKUrdLdrzcsRYGwgObH/6F1cHYeT1SXrCTEIifHeIQSD+m3xv3zGR6FjTjaQMmGOK0veIQstJrkjW06ZAmNE8G8xSDM5h025ruh+MkKJJs3MEwScB+JViPtl2mJZWsq9KZP6pO6datc+4991fVrdL5rMVCrrr31r6/9tlnn/2DGGPQaDQaTeORqLUAGo1Go4kGreA1Go2mQdEKXqPRaBoUreA1Go2mQdEKXqPRaBqUploLwPnIRz7CFixYgLa2tlqL4srY2JiWM2TqRVYtZ7jUi5xAfGUdGBj4F8bYAuGXjLFY/Ld69Wp29OhRVg9oOcOnXmTVcoZLvcjJWHxlBfA6k+hV7aLRaDSaBkUreI1Go2lQtILXaDSaBkUreI1Go2lQtILXaDSaBiU2YZKaaOkbzGDv4dMYyeawKJ3Ctg1LsHFVZ63F0mg0EaIVfMwJQzH3DWbwwIsnkTPzAIBMNocHXjwJAFrJazQNjHbRxBiumDPZHBhmFHPfYMbTcfYePl1S7pycmcfew6dDlFaj0cQNreBjTFiKeSSb8/S5RqNpDLSCjzEyBZzJ5rBuzxFlS35ROuXpc41G0xhoBR9jnBSwF3fNtg1LkDKSZZ+ljCS2bVgSWEaNRhNftIKPMSLFbEXVXbNxVSd2b1qGznQKBKAzncLuTcv0AqtG0+DoKJoYwxXw3sOnkQnoR9+4qlM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/jUy/tUT9fUC7pUgUaj0TQoscpk1Wg0Gk14aAWv0Wg0DYpW8BqNRtOgaAWv0Wg0DYpW8BqNRtOg/P9NrzHOgA0HeQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(x,y,\"o\")\n",
    "#plt.ylim(0,0.5)\n",
    "plt.grid()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 基于scipy.optimizet 的组合投资优化方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [],
   "source": [
    "def min_sharpe(weights):\n",
    "    \n",
    "    weights = weights/np.sum(weights)\n",
    "    z_r=np.sum(np.dot(r_log,weights))\n",
    "    z_f=np.sqrt(np.dot(weights.T, np.dot(r_log.cov()*252, weights)))\n",
    "\n",
    "    return z_f/z_r#optimize是去最小值，所以这里用夏普率的倒数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2.233350945279795"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "min_sharpe(weights)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [],
   "source": [
    "import scipy.optimize as sco"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 148,
   "metadata": {},
   "outputs": [],
   "source": [
    "#help(sco)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "     fun: 0.8939093390352064\n",
       "     jac: array([ 7.92866386e-01,  5.91352582e-05,  4.12997685e-01,  3.19267079e-01,\n",
       "       -3.01741064e-04])\n",
       " message: 'Optimization terminated successfully'\n",
       "    nfev: 36\n",
       "     nit: 6\n",
       "    njev: 6\n",
       "  status: 0\n",
       " success: True\n",
       "       x: array([0.00000000e+00, 8.36158658e-01, 0.00000000e+00, 1.83884121e-17,\n",
       "       1.63841342e-01])"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "noa=5\n",
    "#约束是所有参数(权重)的总和为1。这可以用minimize函数的约定表达如下\n",
    "\n",
    "cons = ({'type':'eq', 'fun':lambda x: np.sum(x)-1})\n",
    "\n",
    "#我们还将参数值(权重)限制在0和1之间。这些值以多个元组组成的一个元组形式提供给最小化函数\n",
    "\n",
    "bnds = tuple((0,1) for x in range(noa))\n",
    "\n",
    "#优化函数调用中忽略的唯一输入是起始参数列表(对权重的初始猜测)。我们简单的使用平均分布。\n",
    "\n",
    "opts = sco.minimize(min_sharpe, noa*[1./noa,], method = 'SLSQP', bounds = bnds, constraints = cons)\n",
    "\n",
    "opts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "     fun: 0.8932822090559589\n",
       "     jac: array([ 1.37371153e-01,  4.12706129e-01, -2.59153545e-04,  7.93547079e-01,\n",
       "        5.06788492e-05])\n",
       " message: 'Optimization terminated successfully'\n",
       "    nfev: 36\n",
       "     nit: 6\n",
       "    njev: 6\n",
       "  status: 0\n",
       " success: True\n",
       "       x: array([5.15901629e-17, 0.00000000e+00, 1.63572666e-01, 8.14224010e-17,\n",
       "       8.36427334e-01])"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "noa=len(stock_set)\n",
    "#约束是所有参数(权重)的总和为1。这可以用minimize函数的约定表达如下\n",
    "\n",
    "cons = ({'type':'eq', 'fun':lambda x: np.sum(x)-1})\n",
    "\n",
    "#我们还将参数值(权重)限制在0和1之间。这些值以多个元组组成的一个元组形式提供给最小化函数\n",
    "\n",
    "bnds = tuple((0,1) for x in range(noa))\n",
    "\n",
    "#优化函数调用中忽略的唯一输入是起始参数列表(对权重的初始猜测)。我们简单的使用平均分布。\n",
    "\n",
    "opts = sco.minimize(min_sharpe, noa*[1./noa,], method = 'SLSQP', bounds = bnds, constraints = cons)\n",
    "\n",
    "opts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.48934441950407487"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum(np.dot(r_log,opts[\"x\"]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.48946330119032233"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum(np.dot(r_log,opts[\"x\"]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.   , 0.   , 0.164, 0.   , 0.836])"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "opts['x'].round(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "metadata": {},
   "outputs": [],
   "source": [
    "#r_log"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.48936542038912945"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sum(np.dot(r_log,opts['x'].round(3)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.48930805654399134"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sum(np.dot(r_log,opts['x'].round(3)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## classwork 4\n",
    "\n",
    "上面是看夏普率最大\n",
    "参考：https://zhuanlan.zhihu.com/p/20604930?refer=quantstory\n",
    "找出投资收益率最大的组合权重"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
